var getType = require("../util/getType");

module.exports = function(obj1, obj2) {
    if (getType(obj1) != "object" || getType(obj2) != "object") {
        console.error("传入的参数必须都为对象");
        return;
    }

    var newObj = {};

    for (var key in obj1) {
        newObj[key] = obj1[key];
    }

    for (var key in obj2) {
        newObj[key] = obj2[key];
    }

    return newObj;
}